<template>
  <div class="m-checkbox-group">
    <slot></slot>
  </div>  
</template>

<script>
  export default {
    props: {
      value: [Array, String]
    },
    mounted() {
      this.updateModel()
    },
    updated() {
      this.updateModel()
    },
    methods: {
      updateModel() {
        if (this.$children) {
          this.$children.forEach(child => {
            child.model = this.value
          })
        }
      },
      change(model) {
        this.$emit('input', model)
        this.$emit('on-change', model)
      }
    }
  }
</script>

<style lang="scss" scoped>
  
</style>